<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Topic extends Model
{
    protected $autoWriteTimestamp = true;

    public function user()
    {
        return $this->belongsTo(User::class,'user_id','id');
        //一篇文章属于一个作者，第一个外键，第二个主键id
    }
}
